package com.modbus.entity.func.response;

import com.modbus.entity.func.AbstractFunction;

/**
 * @author heyayun
 * @description TODO
 * @date 2021/3/23 9:58
 */
public class WriteMultipleCoilsResponse extends AbstractFunction {
    /**
     * startingAddress = 0x0000 to 0xFFFF
     * quantityOfOutputs = 1 - 2000 (0x07D0)
     */
    public WriteMultipleCoilsResponse() {
        super(WRITE_MULTIPLE_COILS);
    }

    public WriteMultipleCoilsResponse(int startingAddress, int quantityOfOutputs) {
        super(WRITE_MULTIPLE_COILS, startingAddress, quantityOfOutputs);
    }

    public int getStartingAddress() {
        return address;
    }

    public int getQuantityOfOutputs() {
        return value;
    }

    @Override
    public String toString() {
        return "WriteMultipleCoilsResponse{" + "startingAddress=" + address + ", quantityOfOutputs=" + value + '}';
    }
}
